package net;

import java.net.InetAddress;

/**
 * Created by Administrator on 2017/10/19 0019.
 */
public class INetAddressDemo
{
    public static void main(String[] args) throws Exception
    {
        InetAddress ia = InetAddress.getByName("www.baidu.com");
        System.out.println(ia.isReachable(1000));
        System.out.println(ia.getHostAddress());
        InetAddress local = InetAddress.getByAddress(new byte[]{127,0,0,1});
        System.out.println("host name = " + local.getCanonicalHostName());
    }
}
